package com.anrongtec.zcpt.ui.activity.myfocus;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

public class MyPagerAdapter extends FragmentPagerAdapter {

    private ArrayList<String> titles;
    private List<Fragment> mFragment ;

    public MyPagerAdapter(FragmentManager fm, ArrayList<String> list,List<Fragment> mFragment) {
        super(fm);
        this.titles = list;
        this.mFragment=mFragment;
    }


    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }

    @Override
    public int getCount() {
        return mFragment.size();
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        return super.instantiateItem(container, position);
    }

    @Override
    public Fragment getItem(int position) {
        return mFragment.get(position);
    }
}
